#ifndef CURVE_AGENT_H

#define CURVE_AGENT_H

#include "PotentialField.h"

#include "TrackLearner.h"

#include "TrackInfo.h"

class CurveAgent : public PotentialField
{
public:
	CurveAgent();
	
	~CurveAgent();

	void update(CarState& cs, const float dt);
	
	void update(CarState& cs, const float dt, TrackLearner& track, const float speed);
	
	const bool getAligning() const;
	
	void calculatePotentialForOptions(DriverOption* const options, unsigned int size);
	
	void setLeftAndRight(const float left, const float right);
	
	const float calculateK(const float lengthToCurve);
private:
	float angles[20];
	
	static const float MAX_DISTANCE;
	static const float MAX_SPEED;
	
	bool aligning;
	int last_state;
	
	float left;
	float right;
	
	int last;
	
	int turn[10];

	int marker;
	
	int turn_nr;
	
	float speed;

	int last_turn;
};


#endif
